package com.hfzy.ihk.facade.linkcall.enums;

import com.hfzy.ihk.common.facade.CustomEnumType;
import com.hfzy.ihk.common.facade.elasticsearch.entity.ElasticsearchTable;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/7/19.
 * 客户的回答类型
 * @author wws
 */
public enum CustomerAnswerType implements CustomEnumType {

    YES("y", "肯定"),
    NO("n", "否定"),
    REJECT("r", "拒绝"),
    UNKNOWN("u", "未识别");
//    OTHER("o", "其他"),
//    SPECIAL("s", "特殊");


    private CustomerAnswerType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    private static Map<String, CustomerAnswerType> map = new HashMap<>();
    static {
        for (CustomerAnswerType value : CustomerAnswerType.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static CustomerAnswerType fromValue(String value) {
        CustomerAnswerType ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + CustomerAnswerType.class + "." + value);
        }
    }

}
